<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{/js/jquery.min.js}"></script>
</head>
<body>
<form action="login" method="post">
    用户名：<input name="username" th:value="${username}" type="text">
    密码：<input name="password" th:value="${password}"  type="text">
</form>

<button type="button" onclick="getOrder()">获取订单</button>
token：<div th:text="${token}"> </div>
code：<div th:text="${code}"> </div>
state：<div th:text="${state}"> </div>

<p id="orderid"> order id:</p>
<p id="productid"> order product id:</p>


<button type="button" onclick="logout()">退出</button>
<script>
    function getOrder(){
        $.get("/api/order/orders/1", function(result){
            console.log(result);
            $("#orderid").html("order id:"+result.id);
            $("#productid").html("order id:"+result.productId);
        });
    }
    function logout(){
        window.location.href="http://auth.yanxiang.com:8090/logout?redirect_uri="+
            "http://admin.yanxiang.com:8088/oauth/callback";
    }


</script>

</body>
</html>